package com.jf.cloud.unicomdata.service.impl;

import com.jf.cloud.common.database.dto.PageDTO;
import com.jf.cloud.common.database.util.PageUtil;
import com.jf.cloud.common.database.vo.PageVO;
import com.jf.cloud.unicomdata.dto.EventRegDTO;
import com.jf.cloud.unicomdata.model.EventReg;
import com.jf.cloud.unicomdata.mapper.EventRegMapper;
import com.jf.cloud.unicomdata.service.EventRegService;
import org.springframework.stereotype.Service;

import org.springframework.beans.factory.annotation.Autowired;

/**
 *
 *
 * @author zz
 * @date 2023-05-21 08:40:16
 */
@Service
public class EventRegServiceImpl implements EventRegService {

    @Autowired
    private EventRegMapper eventRegMapper;

    @Override
    public PageVO<EventReg> page(PageDTO pageDTO, EventRegDTO eventRegDTO) {
        return PageUtil.doPage(pageDTO, () -> eventRegMapper.list(eventRegDTO));
    }

    @Override
    public EventReg getById(Long id) {
        return eventRegMapper.getById(id);
    }

    @Override
    public void save(EventReg eventReg) {
        eventRegMapper.save(eventReg);
    }

    @Override
    public void update(EventReg eventReg) {
        eventRegMapper.update(eventReg);
    }

    @Override
    public void deleteById(Long id) {
        eventRegMapper.deleteById(id);
    }

    @Override
    public Integer countByType(String type) {

        return eventRegMapper.countByType(type);
    }
    @Override
    public Integer countByTypeSex(String type, Integer sex) {

        return eventRegMapper.countByTypeSex(type, sex);
    }
    @Override
    public String getEndTime(String type) {
        return eventRegMapper.getEndTime(type);
    }
}
